//
//  SISSObtainEvidenceShowViewModel.m
//  SISSAPP
//
//  Created by 袁应荣 on 2018/10/31.
//  Copyright © 2018年 优房网. All rights reserved.
//

#import "SISSObtainEvidenceShowViewModel.h"

@implementation SISSObtainEvidenceShowViewModel

- (NSString *)plistName {
    return @"ObtainEvidenceEnrollInfoArray";
}

- (void)setArrWith:(NSString *)str {
    self.dataArr[0][0].rightStr = @"{银行名称}";
    self.dataArr[0][1].rightStr = @"{时间}";
    self.dataArr[1][0].rightStr = @"{情况}";
    self.dataArr[1][1].rightStr = @"{其他说明}";
    self.dataArr[2][0].rightStr = @"{注意事项}";
}

- (UIView *)getViewHeaderInSection:(NSInteger)section {
    
    SISSBaseView *headerView = [[SISSBaseView alloc] init];
    headerView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    UILabel *label = [[UILabel alloc] init];
    label.textColor = COLOR(0x334A60);
    label.font = [UIFont systemFontOfSize:16];
    [headerView addSubview:label];
    
    CGFloat margin = 8.0;
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(headerView).offset(2 * margin);
        make.centerY.equalTo(headerView);
    }];
    
    NSArray *headerTextArr = @[@"取证时间", @"担保公司注销抵押登记", @"注意事项"];
    
    label.text = headerTextArr[section];
    
    return headerView;
}

- (CGFloat)getHeightForHeaderInSection:(NSInteger)section {
    return 44;
}

- (void)assignmentWithObtainEvidenceEnrollModel:(SISSObtainEvidenceEnrollModel *)obtainEvidenceEnrollModel {
    NSDictionary *infoDict = [obtainEvidenceEnrollModel yy_modelToJSONObject];
    for (NSInteger section = 0; section < self.dataArr.count; section++) {
        
        for (NSInteger idx = 0; idx < self.dataArr[section].count; idx++) {
            
            SISSContractModel *obj = self.dataArr[section][idx];
            obj.rightStr = infoDict[obj.propertyKey] != nil ? [NSString stringWithFormat:@"%@",infoDict[obj.propertyKey]] : @"";
        }
    }
    
    [self.tableView reloadData];
}

@end
